<template>
	<input type="text" id="new-todo" @blur="setSubmit" v-model.trim="addtitle">
</template>

<script>
	export default {
		data() {
			return {
				addtitle: ''
			}
		},
		emits: [ 'setlist' ],
		methods: {
			setSubmit() {
				// 判断是否输入事件
				if (this.addtitle.length > 0) {
					// 追加新增事件的状态
					this.$emit('setlist',{check: false, title: this.addtitle, isEdit: false})
					// 重置输入框
					this.addtitle = ''
				}
				
			},
		}
	}
</script>

<style>
</style>
